package com.xdog.okx.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.xdog.okx.service.IOkxAddressService;
import com.xdog.okx.utils.OkxApiUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * OKX地址数据服务实现类
 * 提供地址相关信息查询功能
 */
@Slf4j
@Service
public class OkxAddressServiceImpl implements IOkxAddressService {

    @Override
    public JSONObject getAddressInfo(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/information-evm";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getAddressTokenBalance(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/token-balance";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getAddressTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getAddressNormalTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/normal-transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getAddressInternalTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/internal-transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getAddressTokenTransactionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/token-transaction-list";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getNormalTransactionListMulti(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/normal-transaction-list-multi";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getInternalTransactionListMulti(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/internal-transaction-list-multi";
        return OkxApiUtil.get(requestPath, params);
    }

    @Override
    public JSONObject getNativeTokenPositionList(Map<String, String> params) {
        String requestPath = "/api/v5/xlayer/address/native-token-position-list";
        return OkxApiUtil.get(requestPath, params);
    }
}